Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Proto v0.5.0 #1588

Merged
merged 15 commits into from
Oct 19, 2020
Merged

Update to Proto v0.5.0 #1588

merged 15 commits into from
Oct 19, 2020

Conversation

obecny
Copy link
Member

@obecny obecny commented Oct 9, 2020

Which problem is this PR solving?

Short description of the changes

  • Upgrading to proto ver. 0.5.0
  • Upgrading example to use collector ver. 0.12
  • Upgrading metrics to reflects latest changes in spec as well as in proto ver. 0.5.0
  • Updating Prometheus

@codecov
Copy link

codecov bot commented Oct 9, 2020

Codecov Report

Merging #1588 into master will decrease coverage by 0.04%.
The diff coverage is 85.96%.

@@            Coverage Diff             @@
##           master    #1588      +/-   ##
==========================================
- Coverage   91.44%   91.40%   -0.05%     
==========================================
  Files         165      165              
  Lines        5052     5013      -39     
  Branches     1034     1023      -11     
==========================================
- Hits         4620     4582      -38     
+ Misses        432      431       -1     
Impacted Files Coverage Δ
packages/opentelemetry-api/src/metrics/Metric.ts 100.00% <ø> (ø)
...ry-exporter-prometheus/src/PrometheusSerializer.ts 97.84% <ø> (+1.62%) ⬆️
...emetry-metrics/src/export/ConsoleMetricExporter.ts 62.50% <0.00%> (+3.67%) ⬆️
...ckages/opentelemetry-metrics/src/export/Batcher.ts 92.00% <75.00%> (+0.69%) ⬆️
...lemetry-exporter-collector/src/transformMetrics.ts 92.59% <82.35%> (-4.19%) ⬇️
.../opentelemetry-exporter-collector/src/transform.ts 87.77% <100.00%> (+0.96%) ⬆️
...ages/opentelemetry-exporter-collector/src/types.ts 100.00% <100.00%> (ø)
...emetry-metrics/src/export/aggregators/LastValue.ts 100.00% <100.00%> (ø)
...ntelemetry-metrics/src/export/aggregators/index.ts 100.00% <100.00%> (ø)
packages/opentelemetry-metrics/src/export/types.ts 100.00% <100.00%> (ø)

examples/collector-exporter-node/package.json Outdated Show resolved Hide resolved
@obecny
Copy link
Member Author

obecny commented Oct 13, 2020

@vmarchaud I know you have tested all 3 versions previously, would you be able to test it again, so that one more person will check if all is working fine, just to double check I haven't missed anything ?

@vmarchaud
Copy link
Member

@obecny sure, i will test tomorrow and update if its fine for me

@vmarchaud
Copy link
Member

vmarchaud commented Oct 14, 2020

Got another error:

{"stack":"TypeError: Cannot read property 'counts' of undefined\n    at toHistogramPoint (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:89:37)\n    at toCollectorMetric (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:138:34)\n    at /home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:201:40\n    at Array.map (<anonymous>)\n    at toCollectorInstrumentationLibraryMetrics (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:201:26)\n    at /home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:214:106\n    at Function.from (<anonymous>)\n    at /home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:214:50\n    at Function.from (<anonymous>)\n    at toCollectorResourceMetrics (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:211:18)\n    at Object.toCollectorExportMetricServiceRequest (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/transformMetrics.js:165:26)\n    at CollectorMetricExporter.convert (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/platform/node/CollectorMetricExporter.js:33:35)\n    at CollectorMetricExporter.send (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/platform/node/CollectorExporterNodeBase.js:43:37)\n    at /home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/CollectorExporterBase.js:70:22\n    at new Promise (<anonymous>)\n    at CollectorMetricExporter._export (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/CollectorExporterBase.js:67:16)\n    at CollectorMetricExporter.export (/home/vmarchaud/opentelemetry/obecny-fork/packages/opentelemetry-exporter-collector/build/src/CollectorExporterBase.js:52:14)\n    at /home/vmarchaud/reelevant/node-utils-monorepo/packages/telemetry/node_modules/@opentelemetry/metrics/build/src/export/Controller.js:42:34\n    at new Promise (<anonymous>)\n    at PushController._collect (/home/vmarchaud/reelevant/node-utils-monorepo/packages/telemetry/node_modules/@opentelemetry/metrics/build/src/export/Controller.js:41:16)","message":"Cannot read property 'counts' of undefined","name":"TypeError"}

@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

transformMetrics.js:89:37

did you bootstrap all, especially metrics - there were changes

@vmarchaud
Copy link
Member

vmarchaud commented Oct 14, 2020

did you bootstrap all, especially metrics - there were changes

Yes i did, the repo is a fresh git clone of your branch with lerna bootstrap

EDIT: I dont think we use histogram (only value recorder) in our app too, so i dont understand why i can get the error

@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

did you bootstrap all, especially metrics - there were changes

Yes i did, the repo is a fresh git clone of your branch with lerna bootstrap

ok so just pls tell me how can I reproduce this error

@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

EDIT: I dont think we use histogram (only value recorder) in our app too, so i dont understand why i can get the error

Value Recorder has now Histogram aggregator

@vmarchaud
Copy link
Member

ok so just pls tell me how can I reproduce this error

Well i'm just creating a new instrument and recording a value, i'm looking at the implementation to see why this error could happen

@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

ok so just pls tell me how can I reproduce this error

Well i'm just creating a new instrument and recording a value, i'm looking at the implementation to see why this error could happen

ok I have just modified the example examples/collector-exporter-node/metrics.js

const recorder = meter.createValueRecorder('test_recorder', {
  description: 'Example of a ValueRecorder',
});

const labels = { pid: process.pid, environment: 'staging' };

setInterval(() => {
  requestCounter.bind(labels).add(1);
  upDownCounter.bind(labels).add(Math.random() > 0.5 ? 1 : -1);
  recorder.bind(labels).update(Math.random());
}, 1000);

Running docker from this example
All works fine, can see traces on http://localhost:9090/graph?g0.range_input=1m&g0.expr=test_recorder_sum&g0.tab=0

@vmarchaud
Copy link
Member

Isn't the method used to record a value for the ValueRecorder record and not update as in your example ?
Anyway i think its linked to the fact that the API version is different as the sdk one. I think its safe to merge this

@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

Isn't the method used to record a value for the ValueRecorder record and not update as in your example ?

You right it is record - although

  record(value: number): void {
    this.update(value);
  }

Anyway i think its linked to the fact that the API version is different as the sdk one. I think its safe to merge this

Ok, but I'm wondering why are you getting this error then, the api and metrics changed, Did you use a different example with possibility of different api or ?

@obecny
Copy link
Member Author

obecny commented Oct 14, 2020

@dyladan any idea why EasyCLA is in "waiting mode" ?

@dyladan
Copy link
Member

dyladan commented Oct 14, 2020

This is a known bug. Have to close and reopen the PR to retrigger the CLA check.

@dyladan dyladan closed this Oct 14, 2020
@dyladan dyladan reopened this Oct 14, 2020
@vmarchaud
Copy link
Member

Ok, but I'm wondering why are you getting this error then, the api and metrics changed, Did you use a different example with possibility of different api or ?

I didn't follow any example, just implemented the API from my understand. I will try to debug it further tomorrow

@obecny
Copy link
Member Author

obecny commented Oct 15, 2020

Ok, but I'm wondering why are you getting this error then, the api and metrics changed, Did you use a different example with possibility of different api or ?

I didn't follow any example, just implemented the API from my understand. I will try to debug it further tomorrow

We should use the same example for testing and verifying - by default this is examples/collector-exporter-node if this needs to be changed or updated to cover some additional scenario then we should do it, otherwise it is hard to verify what is not working and why :/

@vmarchaud
Copy link
Member

We should use the same example for testing and verifying - by default this is examples/collector-exporter-node if this needs to be changed or updated to cover some additional scenario then we should do it, otherwise it is hard to verify what is not working and why :/

Well the example is working for me too, i generally prefer to test with a whole service to avoid bad surprise.
Also i know why it wasnt working: i didn't use the correct metrics sdk. It's working fine now.

@obecny
Copy link
Member Author

obecny commented Oct 15, 2020

We should use the same example for testing and verifying - by default this is examples/collector-exporter-node if this needs to be changed or updated to cover some additional scenario then we should do it, otherwise it is hard to verify what is not working and why :/

Well the example is working for me too, i generally prefer to test with a whole service to avoid bad surprise.
Also i know why it wasnt working: i didn't use the correct metrics sdk. It's working fine now.

OK I'm just waiting then for your approval

@vmarchaud
Copy link
Member

@obecny Sorry i forgot the re-approve !

@dyladan dyladan added the Merge:LGTM This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.) label Oct 16, 2020
@obecny obecny merged commit 00a8ce7 into open-telemetry:master Oct 19, 2020
@obecny obecny deleted the proto_v050 branch October 19, 2020 11:37
@dyladan dyladan linked an issue Oct 26, 2020 that may be closed by this pull request
Comment on lines -540 to +538
'# TYPE value_recorder summary',
'# TYPE value_recorder histogram',
Copy link

@PixnBits PixnBits May 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it('should export a ValueRecorder as a summary'

but this assertion was changed to a histogram, is the assertion needed until summaries are brought back? (ex: #982) probably dependent on specification updates?
(would opening a PR to remove this test be appropriate?)

dyladan pushed a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
* chore: updating submodule for opentelemetry-proto

* chore: necessary changes after upgrade to proto ver. 0.5.0, aligning metrics to latest spec changes

* chore: removing examples from lerna bootstrap

* chore: cleaning ups unused interfaces

* chore: fixing unit test

* chore: updating aggregation temporality rules

* chore: updating temporality for value recorder

* chore: removing unneeded lib

* chore: span id and trace id as hex

* chore: adding value recorder to example
dyladan pushed a commit to dyladan/opentelemetry-js that referenced this pull request Sep 9, 2022
* chore: updating submodule for opentelemetry-proto

* chore: necessary changes after upgrade to proto ver. 0.5.0, aligning metrics to latest spec changes

* chore: removing examples from lerna bootstrap

* chore: cleaning ups unused interfaces

* chore: fixing unit test

* chore: updating aggregation temporality rules

* chore: updating temporality for value recorder

* chore: removing unneeded lib

* chore: span id and trace id as hex

* chore: adding value recorder to example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Merge:LGTM This PR is ready to be merged by a Maintainer (has enough valid approvals, successful build, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update proto ver. 0.5.0 and collector Use hex encoding for trace id and span id fields in OTLP JSON encoding
5 participants